package com.blackitheima1.LambdaDemo.test6;

public class TestGetInt {
    public static void main(String[] args) {
        //匿名内部类
        getSum(new AddSum() {
            @Override
            public int getS(int x, int y) {
                return x+y;
            }
        });
        //Lambda表达式
        getSum((x,y)->x+y);

    }
    public static void getSum(AddSum addSum){
        int sum=addSum.getS(4,5);
        System.out.println(sum);
    }
}
//接口
interface AddSum{
    public abstract int getS(int x,int y);
}
